package com.helloworld.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;
import org.springframework.beans.factory.annotation.Autowired;

import com.helloworld.pojo.Supplier;
import com.helloworld.service.SupplierService;
import com.helloworld.util.PageBean;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class SupplierAction extends ActionSupport{
	@Autowired
	private SupplierService supplierService;
	
	private Supplier supplier;//查询条件
	private Integer currPage;//当前页
	
	public String findSupplierByPage() {
		if (currPage==null || currPage < 1) {
			currPage = 1;
		}
		PageBean pageBean = supplierService.findSupplierByPage(supplier,currPage);
		ActionContext.getContext().getSession().put("pageBean", pageBean);
		return "findSuccess";
	}

	
//	get/set方法，用于接收前端页面参数
	public Supplier getSupplier() {
		return supplier;
	}
	public void setSupplier(Supplier supplier) {
		this.supplier = supplier;
	}
	public int getCurrPage() {
		return currPage;
	}
	public void setCurrPage(int currPage) {
		this.currPage = currPage;
	}
	

}
